/*
 * Copyright © 2004-2014 chenYuan. All rights reserved.
 * @Website:wwww.jspx.net
 * @Mail:39793751@qq.com
 * @author: chenYuan , 陈原
 * @License: Jspx.net Framework Code is open source (LGPL)，Jspx.net Framework 使用LGPL 开源授权协议发布。
 * @jvm:jdk1.6+  x86/amd64
 *
 */
package com.jspx.txweb.table;

import com.jspx.sober.annotation.*;
import com.jspx.sober.table.OperateTable;
import com.jspx.utils.StringUtil;

/**
 * Created by IntelliJ IDEA.
 * User: chenYuan
 * Date: 2010-7-15
 * Time: 22:34:12
 */
@Table(name = "jspx_action_log", caption = "动作日志")
public class ActionLog extends OperateTable {

    @Id(auto = true, type = IDType.serial)
    @Column(caption = "ID", notNull = true)
    private long id;

    @Column(caption = "名称", length = 200, dataType = "isLengthBetween(2,200)", notNull = true)
    private String caption = StringUtil.empty;

    @Column(caption = "类名", length = 200, dataType = "isLengthBetween(2,200)", notNull = true)
    private String className = StringUtil.empty;

    @Column(caption = "方法名称", length = 200, dataType = "isLengthBetween(2,200)", notNull = true)
    private String methodCaption = StringUtil.empty;

    @Column(caption = "类名", length = 200, dataType = "isLengthBetween(2,200)", notNull = true)
    private String classMethod = StringUtil.empty;

    @Column(caption = "返回", length = 100, dataType = "isLengthBetween(2,100)", notNull = true)
    private String actionResult = StringUtil.empty;

    @Column(caption = "说明", length = 250, dataType = "isLengthBetween(2,250)", notNull = false)
    private String title = StringUtil.empty;

    @Column(caption = "正文", length = 8000, dataType = "isLengthBetween(2,8000)", notNull = false)
    private String content = StringUtil.empty;

    @Column(caption = "类型", length = 100, notNull = false)
    private String objectType = StringUtil.empty;

    @Column(caption = "说明", notNull = false)
    private long objectId = 0;

    //根据用户配置设置
    @Column(caption = "显示", option = "0:显示;1:隐藏", notNull = false)
    private int showType = 0;

    @Column(caption = "地址", length = 250, dataType = "isLengthBetween(2,250)", notNull = true)
    private String url = StringUtil.empty;

    @Column(caption = "命名空间", length = 100, dataType = "isLengthBetween(2,100)", notNull = true)
    private String namespace = StringUtil.empty;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCaption() {
        return caption;
    }

    public void setCaption(String caption) {
        this.caption = caption;
    }

    public String getMethodCaption() {
        return methodCaption;
    }

    public void setMethodCaption(String methodCaption) {
        this.methodCaption = methodCaption;
    }

    public String getClassMethod() {
        return classMethod;
    }

    public void setClassMethod(String classMethod) {
        this.classMethod = classMethod;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getObjectType() {
        return objectType;
    }

    public void setObjectType(String objectType) {
        this.objectType = objectType;
    }

    public long getObjectId() {
        return objectId;
    }

    public void setObjectId(long objectId) {
        this.objectId = objectId;
    }

    public int getShowType() {
        return showType;
    }

    public void setShowType(int showType) {
        this.showType = showType;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getActionResult() {
        return actionResult;
    }

    public void setActionResult(String actionResult) {
        this.actionResult = actionResult;
    }

    public String toLog()
    {
        StringBuffer sb = new StringBuffer();
        sb.append("caption:").append(caption).append(" ").append("methodCaption:").append(methodCaption).append(" ").append("title:").append(title).append(" ").append(content);
        return sb.toString();
    }
}